﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace MuggleTactics
{
    class Tile
    {
        // Properties
        private Piece piece;
        private Vector2 location;
        private bool isOccupied = false;
        private bool inRange;

        // Getters
        public Piece getPiece() { return piece; }
        public Vector2 getLocation() { return location; }
        public bool getIsOccupied() { return isOccupied; }
        public bool getInRange() { return inRange; }

        // Setters
        public void setPiece(Piece piece) {
            if (isOccupied != true)
            {
                this.piece = piece;
            }
            if (this.piece != null)
            {
                this.isOccupied = true;
                Vector2 tmpV2 = new Vector2();
                tmpV2.X = this.location.X + 10;
                tmpV2.Y = this.location.Y;
                this.piece.setPosition(tmpV2);
            }
        
        }
        public void setLocation(Vector2 location) { this.location = location; }
        public void setIsOccupied(bool isOccupied) { this.isOccupied = isOccupied; }
        public void setInRange(bool inRange) { this.inRange = inRange; }

        public Tile(Piece piece, Vector2 location)
        {
            this.setPiece(piece);
            if (piece != null)
            {
                this.isOccupied = true;
            }
            this.setLocation(location);
        }
    }
}